/*
 * main.cpp
 *
 *  Created on: 16/mag/2012
 *      Author: matteo
 */


#include <iostream>
#include <string>

#include "HashManager.h"
#include "RabinKarp.h"
#include "Chrono.h"
#include "File.h"
#include <cmath>

void my_function(int exp)
{
	pow(3, exp);
}

void my_function_ot()
{
	int base = 3;
	int exp = 1000;
	int ret = 1;
	for (int i = 0; i < exp; i++)
	{
		ret *= base;
	}
}

int Pow(int base, int exponent)
{
    int result = 1;

    while (exponent)
    {
        if(exponent & 1)
        {
            result *= base;
        }
        base*=base;
        exponent = exponent >> 1;
    }
    return result;
}

int main()
{
	Chrono chrono;
	chrono.start();
//	File f;
//	f.open(".", "myfile");
//	f.read();
//	char pattern[] = "LbhusWokGFONUjEUTikgzfi";
//	char* text_str = "hi";
//	HashManager m(101, 2, text_str);
//	char* text_str = f.getData();
//	RabinKarp rk(text_str, pattern );
//	rk.match();
	char* text = "abcd";
	HashManager m(10, 4, text);
	chrono.end();
	std::cout << "time: " << chrono.time_elapsed();
}

